// 错误上报
(function() {
  function report(data) {
    if (typeof data != "object") {
      return;
    }
    try {
      var user = JSON.parse(localStorage.getItem("userinfo"));
      if ([] instanceof Array) {
        for (var i = 0; i <= data.length; i++) {
          data[i].user = user;
        }
      } else {
        data.user = user;
        data.userAgent = data.userAgent || window.navigator.userAgent;
        data.type = data.type || 0;
        data.baseUrl = data.baseUrl || window.location.href;
      }
    } catch (error) {}
    new Image().src =
      "https://admin.yitianyishu.com/node_service/applog/send/pc?e=" +
      JSON.stringify(data);
  }
  jstracker.init({
    maxError: 26,
    report: report
  });
  window.reportError = report;
})();
